<template>
  <div>
    <textarea class="textarea" v-model="html"></textarea>
    <van-button type="primary" block @click="handleSubmit">提交</van-button>
  </div>
</template>

<script setup>
import axios from 'axios'
import { ref } from 'vue'
import { useRoute } from 'vue-router'

const html = ref('')
const route = useRoute()
const { id } = route.query
const handleSubmit = async () => {
  const resp = await axios.post('/api/write/message', { id, html: html.value })
  console.log(resp.data)
}
</script>

<style lang="scss" scoped>
.textarea {
  width: 100vw;
  height: 400px;
  border: none;
  padding: 4px;
}
</style>
